﻿using Domain.Entity.Basic_information;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configer.Basic_information
{
    public class cargo_mentConfiger : IEntityTypeConfiguration<Cargo_ment>
    {
        public void Configure(EntityTypeBuilder<Cargo_ment> builder)
        {
            builder.ToTable(nameof(Cargo_ment));
            builder.HasKey(e => e.Cg_id);
            builder.Property(e => e.Cg_id).HasColumnType("bigint");
            builder.Property(e => e.Cg_name).HasColumnType("varchar(20)");
            builder.Property(e => e.Cg_length).HasColumnType("float(2)");
            builder.Property(e => e.Cg_width).HasColumnType("float(2)");
            builder.Property(e => e.Cg_height).HasColumnType("float(2)");
            builder.Property(e => e.Cg_volume).HasColumnType("float(2)");
            builder.Property(e => e.Cg_weight).HasColumnType("float(2)");
            builder.Property(e => e.Cg_value).HasColumnType("decimal(18,2)");
            builder.Property(e => e.Cg_unit).HasColumnType("varchar(20)");
            builder.Property(e => e.Cg_status).HasColumnType("tinyint").IsRequired().HasComment("货物状态：0、禁用 1、启用");
            builder.Property(e => e.Cg_remarks).HasColumnType("varchar(64)");

        }
    }
}
